logic gates in number system